pub const Player = struct {
	length: u8 = 3,
	y: u8 = 0,
	position: u8 = 0,


	pub fn start(self: *Player) u8 {
		return self.position;
	}


	pub fn end(self: *Player) u8 {
		return self.position +| (self.length - 1);
	}


	pub fn mid(self: *Player) ?u8 {
		const has_mid: bool = self.length % 2 == 1;
		const mid_pos: u8 = self.position +| self.length / 2;

		return if (has_mid) mid_pos else null;
	}


	pub fn colliding(self: *Player, x: u8, y: u8) bool {
		if (
				y == self.y
				and (x >= self.start() and x <= self.end())
		) {
			return true;
		}

		return false;
	}
};
